package com.example.service.impl;

import com.example.Dao.UserDao;
import com.example.entity.Goods;
import com.example.entity.Users;
import com.example.service.UserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    UserDao userDao;
    @Override
    public PageInfo<Users> queryAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize );
        List<Users> list=userDao.queryAll();
        PageInfo<Users> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
    @Override
    public int deleteByID(Integer id) {
        return userDao.deleteByID(id);
    }

    @Override
    public Users findById(Integer uID) {
        return userDao.findById(uID);
    }

    @Override
    public int update(Users users) {
        return userDao.update(users);
    }

    @Override
    public int insert(Users users) {
        return userDao.insert(users);
    }

    @Override
    public Users foundByID(Integer uID) {
        return userDao.foundByID(uID);
    }

}
